<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!DOCTYPE html>
<html lang="pl">  
    <head>
        <jsp:include page="./../util/configurationPage.jsp"/>
        <style type="text/css">
            #inner {
                display: table;
                margin: 0 auto;
            }

            #activeEx {
                background-color : #5CB85C;
                color:#ffffff;
                border: 1px;

            }
            .form-signin {
                max-width: 400px;
                padding: 19px 29px 29px;


            }
            #signinEx {
                max-width: 500px;
                font-size: 16px;
                height: auto;
                margin-bottom: 10px;
            }
            #signinEx2 {
                max-width: 500px;
                font-size: 16px;
                height: auto;
                padding-bottom: -5px;
            }
            .form-signin input[type="text"],
            .form-signin input[type="password"] {
                font-size: 16px;
                height: auto;
                margin-bottom: 15px;
                padding: 7px 9px;
            }
            .input-group-addon {
                min-width:70px;
                text-align: left;
            }
            .error {
                font-size: 14px;
                color:red;
            }
        </style>

        <script type="text/javascript">
            $(window).on('load', function() {

                $('.selectpicker').selectpicker();

                // $('.selectpicker').selectpicker('hide');
            });
        </script>
    </head>
    <body>
        <jsp:include page="./../navbar/navbarMain.jsp"/>
        <br>

        <div class="container ">
            <div class="col-lg-12">
                <div class="row">
                    <div class="col-lg-3">
                        <jsp:include page="./../navbar/menuBar.jsp"/>
                    </div>
                    <div class="col-lg-9">
                        <div class="panel panel-success">

                            <div class="panel-heading">
                                <h3 class="panel-title">Dodawanie produktu</h3>
                            </div>
                            <div class="panel-body">
                                <form:form method="POST" commandName="commandBean" action="add.htm" enctype="multipart/form-data">
                                    <div class="row"> 
                                        <div class="col-lg-7">
                                            <div class="input-group" id="signinEx" >
                                                <span class="input-group-addon">Nazwa</span>
                                                <form:input path="name" type="text" class="form-control " value=""   size="40" />
                                            </div>
                                        </div> 

                                        <form:errors path="name" class="error " />
                                    </div>

                                    <div class="row"> 
                                        <div class="col-lg-7">
                                            <div class="input-group"  id="signinEx" >
                                                <span class="input-group-addon">Opis</span>
                                                <form:textarea path="description" rows="4" cols="50"  class="form-control" /> 
                                            </div>
                                        </div> 

                                        <form:errors path="description" cssClass="error" />

                                    </div>

                                    <div class="row"> 
                                        <div class="col-lg-7">
                                            <div class="input-group"  id="signinEx" >
                                                <span class="input-group-addon">Cena</span>
                                                <form:input path="price" type="text" class="form-control" value=""   size="40" />
                                            </div>
                                        </div> 

                                        <form:errors path="price" cssClass="error" />

                                    </div>

                                    <div class="row"> 
                                        <div class="col-lg-7">
                                            <div class="input-group"  id="signinEx" >
                                                <span class="input-group-addon">Ilość</span>
                                                <form:input path="amount" type="text" class="form-control" value=""   size="40" />
                                            </div>
                                        </div> 

                                        <form:errors path="amount" cssClass="error" />

                                    </div>

                                    <div class="row"> 
                                        <div class="col-lg-5">
                                            <div class="input-group"  id="signinEx2" >
                                                <form:select class="selectpicker" title="Kategoria" data-style="btn-success" data-width="254px" path="categoryName">
                                                    <form:option  value="" label="" />
                                                    <form:options  items="${categoryList}"  itemValue="name" itemLabel="name" />
                                                </form:select>

                                            </div>      </div>
                                      
                                            <form:errors path="categoryName" cssClass="error" />
                                    </div>

                                    <div class="row"> 
                                        <div class="col-lg-5">

                                            <div class="input-group"  id="signinEx2" >
                                                <form:select class="selectpicker" title="Producent" data-style="btn-success" data-width="254px" path="manufacturerName">
                                                    <form:option  value="" label="" />
                                                    <form:options  items="${manufacturerList}"  itemValue="name" itemLabel="name" />
                                                </form:select>

                                            </div>   </div> 
                                        
                                            <form:errors path="manufacturerName" cssClass="error" />

                                    </div>

                                    <div class="fileupload fileupload-new" data-provides="fileupload">
                                        <span class="btn btn-success btn-file"><span class="fileupload-new">Wybierz plik</span>
                                        <span class="fileupload-exists">Zmień</span> <form:input type="file" path="image" /></span>
                                        <div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 200px; max-height: 150px; line-height: 20px;"></div>
                                        <a href="#" class="close fileupload-exists" data-dismiss="fileupload" style="float: none">×</a>
                                    </div>   

                                <br>
                                <button class="btn  btn-primary pull-right" type="submit">Dodaj</button>
                            </form:form>
                        </div>
                    </div>
                </div>
            </div>  
        </div>
    </div>


    <jsp:include page="./../util/footer.jsp"/>
</body>
</html>

